﻿@model TCCVoigt.Models.ModuloHabilidade

@{
    ViewBag.Title = "Edit";
}

<h2>Edição</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>

<script type="text/javascript">
    $(document).ready(function () {

        $("#CodigoSistema").change(function () {
            $.getJSON('@Url.Action("ListaModulo", "SolicitacaoMudanca")', { sistema: $(this).val() }, function (data) {
                $("#CodigoModulo").empty();
                $.each(data, function (index, optionData) {
                    $("#CodigoModulo").append("<option value='" + optionData.Value + "'>" + optionData.Text + "</option>");
                });
            });
        });
    });
</script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>RecursoHabilidade</legend>

        @Html.HiddenFor(model => model.Codigo)

        <div class="editor-label">
            <label>Sistema</label>
        </div>
        <div class="editor-field">
            @Html.DropDownList("CodigoSistema", String.Empty)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.CodigoModulo, "Modulo")
        </div>
        <div class="editor-field">
            @Html.DropDownList("CodigoModulo", String.Empty)
            @Html.ValidationMessageFor(model => model.CodigoModulo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CodigoHabilidade, "Habilidade")
        </div>
        <div class="editor-field">
            @Html.DropDownList("CodigoHabilidade", String.Empty)
            @Html.ValidationMessageFor(model => model.CodigoHabilidade)
        </div>

        <p>
            <input type="submit" value="Salvar" />
        </p>
    </fieldset>
}

<div>
    <a href="@Url.Action("Index")"><img src="~/Images/ico_back.png" alt="" border="0" style="float: left"/>Voltar</a>
</div>
